package com.tyl.controller;


import com.tyl.ResultEntity;
import com.tyl.entity.Attr;
import com.tyl.service.IAttrService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 商品属性 前端控制器
 * </p>
 *
 * @author 汤云龙
 * @since 2022-03-23
 */
@RestController
@RequestMapping("/attr")
public class AttrController {
    @Resource
    private IAttrService attrService;
    @GetMapping("/selectAttrByGroupId/{groupId}")
    public ResultEntity selectAttrByGroupId(@PathVariable("groupId") Long groupId){
        List<Attr> attrs = attrService.selectAll(groupId);
        return ResultEntity.ok(attrs);
    }

}

